import structure1.Demo1;
import structure2.ProgramC;
import structure3.ProgramD;
import structure4.ProgramA;

import java.io.IOException;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        System.out.println("选择你要使用的程序风格");
        System.out.println("1.主程序-子程序软件体系结构");
        System.out.println("2.面向对象软件体系结构");
        System.out.println("3.面向对象软件体系结构");
        System.out.println("4.管道-过滤软件体系结构");
        Scanner scanner = new Scanner(System.in);
        System.out.println("输入数字选择:");
        int number = scanner.nextInt();
        try {
            switch (number) {
                case 1:
                    Demo1.main(null);
                    break;
                case 2:
                    ProgramC programC = new ProgramC();
                    programC.run("E:\\Java项目\\input.txt", "E:\\Java项目\\output2.txt");
                    break;
                case 3:
                    ProgramD programD = new ProgramD();
                    programD.run("E:\\Java项目\\input.txt", "E:\\Java项目\\output3.txt");
                    break;
                case 4:
                    ProgramA programA = new ProgramA();
                    programA.run("E:\\Java项目\\input.txt", "E:\\Java项目\\output4.txt");
                    break;
                default:
                    System.out.println("非法输入，程序退出");
            }
        } catch (Exception e) {
            System.out.println("程序异常，终止运行");
        }
    }
}
